﻿using AutoMapper;
using TodoApi.Controllers.DTO;
using TodoApi.Models;

namespace TodoApi.Prifiles
{
    public class MapperProfile:Profile
    {
        public MapperProfile()
        {
            CreateMap<Student, StudentDTO>().ForMember(x => x.SexName, y => y.MapFrom(a => a.Sex));
            CreateMap<StudentDTO, Student>().ForMember(x=>x.Sex ,y=>y.MapFrom(a=>a.SexName));
        }
    }
}
